/* 获取系统信息 */
var express = require('express');
var router = express.Router();
var lang = require('../lib/lang.json');
var os = require('os');

router.route('/sysinfo')
  .get(function (req, res, next) {
    var time = new Date().getTime();
    res.status(200).json({
      status: 1,
      data: {
        freeMem: os.freemem(),
        totalMem: os.totalmem(),
        hostName: os.hostname(),
        type: os.type(),
        sysTime: time,
        upTime: os.uptime()
      },
      message: lang.success
    })
  });

module.exports = router;